package 单例模式;

/**
 * 饱汉模式:
 *      线程不安全的
 */

public class Singleton2 {

    private static Singleton2 singleton2;

    private Singleton2() {
    }

    public static Singleton2 getSingleton2() {
        if (singleton2 == null) {
            return new Singleton2();
        }
        return singleton2;
    }
}
